<template>
	<view>
		<u-status-bar></u-status-bar>
		<view class="con">
			<view class="con__head">
				<view class="con__head__title">
					书币余额（金币）
				</view>
				<view class="con__head__num">
					660
				</view>
				<view class="u-flex u-flex-y-center u-flex-between">
					<view class="con__head__hb">
						<text class="con__head__hb__num">300</text>
						<text class="con__head__hb__text">红包</text>
					</view>
					<view class="con__head__btn">
						查看余额详情
					</view>
				</view>
			</view>
			<view class="u-flex u-flex-y-center u-flex-between u-flex-wrap">
				<view class="con__item" v-for="(item,index) in list" :key="index" @click="curindex=index,show=true">
					<view class="con__item__border" v-if="curindex==index">

					</view>
					<view class="con__item__tips">
						热门
					</view>
					<view class="con__item__m">
						<view class="con__item__m__u">
							¥
						</view>
						<view class="con__item__m__n">
							66
						</view>
						<view class="con__item__m__s">
							多送66元
						</view>
					</view>
					<view class="con__item__j">
						<view class="con__item__j__v1">
							4800
						</view>
						<view class="con__item__j__v2">
							金币
						</view>
						<view class="con__item__j__v3" style="margin: 0 8rpx;">
							+
						</view>
						<view class="con__item__j__v3">
							500
						</view>
						<view class="con__item__j__v4">
							红包
						</view>
					</view>

				</view>
			</view>

			<view class="con__sm">
				说明：</br>
				1.100金币=1元，虚拟商品购买不可退换，敬请见谅；</br>
				2.充值赠送红包有效期为7天，过期自动失效：消费时优先扣除距离过期时间最近的红包；</br>
				3.充值后阅读计费章节时自动扣除金币/红包；</br>
				4.充值后书币到账可能有延迟，1小时内未到账请与客服联系；</br>
				5.未满18周岁的未成年人，应在父母或其他监护人的监护、指导、同意下进行如付费充值、付费阅读等相关操作。
			</view>
		</view>

		<u-popup :show="show" @close="close" @open="open" round='24rpx' closeable>
			<view class="popbox">
				<view class="popbox__price">
					<text class="popbox__price__u">￥</text>
					<text>66</text>
				</view>
				<u-count-down :time="30 * 60 * 60 * 1000" ref="countDown" format="DD:HH:mm:ss" autoStart millisecond @change="onChange">
					<view class="time">
						<text class="time__item" style="margin-right: 8rpx;">剩余时间&nbsp; </text>
						<text class="time__item">{{ timeData.hours>10?timeData.hours:'0'+timeData.hours}}:</text>
						<text class="time__item">{{ timeData.minutes }}:</text>
						<text class="time__item">{{ timeData.seconds }}</text>
					</view>
				</u-count-down>
				<view class="popbox__type">
					<view class="popbox__type__title">
						支付方式
					</view>
					<view class="popbox__type__item" v-for="(item,index) in paylist" :key="index" @click="curpay=index">
						<view class="u-flex u-flex-y-center">
							<image :src="'/static/cz/'+item.icon+'.png'" class="popbox__type__item__icon" mode=""></image>
							{{item.text}}
						</view>
						<view class="popbox__type__item__check">
							<image src="/static/cz/xuan.png" v-if="curpay==index" class="popbox__type__item__check__icon" mode=""></image>
							<image src="/static/cz/noxuan.png" v-else class="popbox__type__item__check__icon" mode=""></image>
							
						</view>
					</view>
				</view>
				<u-button :loading='loading' @click="submit" loadingText='加载中' text="去支付" color="#51CAEF" class="custom-style"></u-button>
			</view>
		</u-popup>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				loading:false,
				curpay:0,
				timeData: {},
				paylist:[
					{text:'微信支付',icon:'wx',type:''},
					{text:'支付宝',icon:'zfb',type:''},
					{text:'云闪付',icon:'ysf',type:''},
				],
				show: false,
				list: [{
						price: '66',
						s: '66',
						tips: '热门',
						jb: '6600',
						hb: '6600'
					},
					{
						price: '29',
						s: '8',
						tips: '新人福利',
						jb: '2900',
						hb: '800'
					},
					{
						price: '48',
						s: '52',
						tips: '仅限首次充值',
						jb: '4800',
						hb: '5200'
					},
					{
						price: '66',
						s: '66',
						tips: '热门',
						jb: '6600',
						hb: '6600'
					},
					{
						price: '66',
						s: '66',
						tips: '热门',
						jb: '6600',
						hb: '6600'
					},
					{
						price: '66',
						s: '66',
						tips: '热门',
						jb: '6600',
						hb: '6600'
					},
					{
						price: '66',
						s: '66',
						tips: '热门',
						jb: '6600',
						hb: '6600'
					},
				],
				curindex: 0
			};
		},
		methods: {
			close() {
				this.show=false
			},
			open() {
				// this.$refs.countDown.start();
			},
			onChange(e) {
				this.timeData = e
			}
		}
	}
</script>

<style lang="scss">
	.con {
		padding: 24rpx;

		&__head {
			background: linear-gradient(139deg, #65D3F5 0%, #00C3FF 100%);
			box-shadow: 0rpx 8rpx 16rpx 0rpx rgba(8, 197, 255, 0.33);
			border-radius: 12rpx 12rpx 12rpx 12rpx;
			padding: 48rpx;

			&__title {
				font-family: PingFang SC, PingFang SC;
				font-weight: 400;
				font-size: 28rpx;
				color: #FFFFFF;
				line-height: 40rpx;
			}

			&__num {
				font-family: DIN, DIN;
				font-weight: bold;
				font-size: 64rpx;
				color: #FFFFFF;
				line-height: 78rpx;
				margin-bottom: 16rpx;
			}

			&__hb {
				&__num {
					font-family: DIN, DIN;
					font-weight: bold;
					font-size: 40rpx;
					color: #FFFFFF;
					line-height: 48rpx;
					margin-right: 4rpx;
				}

				&__text {
					font-family: PingFang SC, PingFang SC;
					font-weight: 400;
					font-size: 28rpx;
					color: #FFFFFF;
					line-height: 40rpx;
				}
			}

			&__btn {
				padding: 0 24rpx;
				line-height: 56rpx;
				background: linear-gradient(180deg, rgba(255, 255, 255, 0.64) 0%, rgba(255, 255, 255, 0.84) 47%, rgba(255, 255, 255, 0.91) 100%);
				box-shadow: 0rpx 2rpx 6rpx 0rpx rgba(0, 0, 0, 0.04);
				border-radius: 1998rpx 1998rpx 1998rpx 1998rpx;
				// border: 1rpx solid;
				border-image: linear-gradient(180deg, rgba(255, 255, 255, 1), rgba(255, 255, 255, 0)) 1 1;
				font-family: PingFang SC, PingFang SC;
				font-weight: bold;
				font-size: 28rpx;
				color: #51CAEF;

			}
		}

		&__item {
			display: flex;
			flex-direction: column;
			justify-content: center;
			width: 339rpx;
			height: 210rpx;
			background: #FFFFFF;
			border-radius: 12rpx 12rpx 12rpx 12rpx;
			position: relative;
			margin-top: 24rpx;

			&__border {
				position: absolute;
				background-color: transparent;
				border: 4rpx solid #51CAEF;
				top: 0;
				left: 0;
				width: 332rpx;
				height: 202rpx;
				z-index: 2;
				border-radius: 12rpx;
			}

			&__tips {
				padding: 0 16rpx;
				line-height: 42rpx;
				background: linear-gradient(229deg, #FF5C00 0%, #FF9356 100%);
				border-radius: 0rpx 12rpx 0rpx 12rpx;
				font-family: PingFang SC, PingFang SC;
				font-weight: bold;
				font-size: 24rpx;
				color: #FFFFFF;
				width: fit-content;
				position: absolute;
				top: 0;
				right: 0;
				z-index: 1;
			}

			&__m {
				display: flex;
				align-items: center;
				margin-bottom: 16rpx;
				padding-left: 32rpx;

				&__u {
					font-family: DIN, DIN;
					font-weight: bold;
					font-size: 28rpx;
					color: #000000;
					line-height: 42rpx;
					// align-self: flex-end;
				}

				&__n {
					font-family: DIN, DIN;
					font-weight: bold;
					font-size: 52rpx;
					color: #000000;
					line-height: 64rpx;
				}

				&__s {
					line-height: 34rpx;
					background: linear-gradient(139deg, #65D3F5 0%, #00C3FF 100%);
					border-radius: 16rpx 16rpx 16rpx 0rpx;
					padding: 0 8rpx;
					font-family: PingFang SC, PingFang SC;
					font-weight: bold;
					font-size: 24rpx;
					color: #FFFFFF;
					margin-left: 8rpx;
				}
			}

			&__j {
				padding-left: 32rpx;
				display: flex;
				align-items: center;

				&__v1 {
					font-family: DIN, DIN;
					font-weight: bold;
					font-size: 28rpx;
					color: #000000;
					line-height: 28rpx;
				}

				&__v2 {
					font-family: PingFang SC, PingFang SC;
					font-weight: 400;
					font-size: 24rpx;
					color: #000000;
					line-height: 28rpx;
				}

				&__v3 {
					font-family: DIN, DIN;
					font-weight: bold;
					font-size: 28rpx;
					color: #51CAEF;
					line-height: 28rpx;
				}

				&__v4 {
					font-family: PingFang SC, PingFang SC;
					font-weight: 400;
					font-size: 24rpx;
					color: #51CAEF;
					line-height: 28rpx;
				}
			}
		}

		&__sm {
			font-family: PingFang SC, PingFang SC;
			font-weight: 400;
			font-size: 26rpx;
			color: #999999;
			line-height: 47rpx;
			text-align: justified;
			margin-top: 24rpx;
		}
	}

	.popbox {
		// width: 750rpx;
		// height: 860rpx;
		background: #F3F5F7;
		border-radius: 24rpx 24rpx 0rpx 0rpx;
		padding: 96rpx 24rpx 20rpx;
		
		&__price {
			display: flex;
			align-items: flex-end;
			justify-content: center;
			font-family: DIN, DIN;
			font-weight: bold;
			font-size: 72rpx;
			color: #000000;
			line-height: 88rpx;

			&__u {
				font-family: DIN, DIN;
				font-weight: 500;
				font-size: 48rpx;
				color: #000000;
				line-height: 74rpx;
			}
		}
		&__type{
			margin-top: 48rpx;
			background: #FFFFFF;
			border-radius: 12rpx 12rpx 12rpx 12rpx;
			padding: 0 24rpx;
			margin-bottom: 48rpx;
			&__title{
				font-family: PingFang SC, PingFang SC;
				font-weight: 400;
				font-size: 28rpx;
				color: #000000;
				line-height: 88rpx;
			}
			&__item{
				height: 96rpx;
				border-radius: 0rpx 0rpx 0rpx 0rpx;
				display: flex;
				align-items: center;
				justify-content: space-between;
				font-family: PingFang SC, PingFang SC;
				font-weight: 400;
				font-size: 32rpx;
				color: #333333;
				line-height: 32rpx;
				&__icon{
					width: 48rpx;
					height: 48rpx;
					margin-right: 14rpx;
				}
				&__check{
					&__icon{
						width: 36rpx;
						height: 36rpx;
					}
				}
			}
		}
		.time {
			font-family: PingFang SC, PingFang SC;
			font-weight: 400;
			font-size: 28rpx;
			color: #999999;
			line-height: 40rpx;
			text-align: center;
		}
	}
</style>